package com.fumihiko.modules.jxxm.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fumihiko.common.utils.PageUtils;
import com.fumihiko.common.utils.Query;

import com.fumihiko.modules.jxxm.dao.IncomeStandardDao;
import com.fumihiko.modules.jxxm.entity.IncomeStandardEntity;
import com.fumihiko.modules.jxxm.service.IncomeStandardService;


@Service("incomeStandardService")
public class IncomeStandardServiceImpl extends ServiceImpl<IncomeStandardDao, IncomeStandardEntity> implements IncomeStandardService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String nd = (String)params.get("nd");
        IPage<IncomeStandardEntity> page = this.page(
                new Query<IncomeStandardEntity>().getPage(params),
                new QueryWrapper<IncomeStandardEntity>().like(StringUtils.isNotBlank(nd),"nd",nd)
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils searchPage(Map<String, Object> params) {
        String nd = (String)params.get("nd");
        IPage<IncomeStandardEntity> page = this.page(
                new Query<IncomeStandardEntity>().getPage(params),
                new QueryWrapper<IncomeStandardEntity>().like(StringUtils.isNotBlank(nd),"nd",nd)
        );

        return new PageUtils(page);
    }

}
